$(function(){
	goToPage(1);
});
function goToPage(pageNo){
	var deviceName = $('#deviceName').val();
	$.ajax({
		url : contextPath+ 'user/zyznglkg/list',
		data : {
			stationcode : parentDeviceId,
			stationdevicetype : prentDeviceType,
			deviceName:deviceName,
			pageNo : pageNo,
			pageSize:10
		},
		type : 'POST',
		success : function(list) {
			$(".pwsj_right_byq_divbox").empty();
			$(".page").empty();
			if(list!=null && list.totalRecord>0){
				var obj = list.records;
				for(var i=0;i<obj.length;i++){
					var div= '<ul class="byq_cont_ul">';
					div += '<li id="deviceBox" name="deviceBox" class="" style="width:4%;"><input type="checkbox" value="'+obj[i].deviceid+'" class="checkbox" /></li>';
					div += '<li style="width:20%;"><a href="'+contextPath+'user/z/zyznglkginfo.jsp?deviceid='+obj[i].deviceid+'">'+obj[i].devicename+'</a></li>';
					div += '<li style="width:20%;">'+(obj[i].linecode==null?"":obj[i].linecode)+'</li>';
					div += '<li style="width:12%;">'+(obj[i].stationcode==null?"":obj[i].stationcode)+'</li>';
					div += '<li style="width:12%;">'+(obj[i].model==null?"":obj[i].model)+'</li>';
					div += '<li style="width:12%;">'+(obj[i].productionfactory==null?"":obj[i].productionfactory)+'</li>';
					div += '<li class="operate" style="width:19%; border-right:none;">';
					//权限判断
//					if(true){
//						div += '<a href="'+contextPath+'user/z/zyznglkgadd.jsp?deviceid='+obj[i].deviceid+'&devicetype=2" class="detail_a">新增线路</a>';
//					}
//					if(true){
//						div +=	'<a href="'+contextPath+'user/z/zyznglkglist.jsp?deviceid='+obj[i].deviceid+'&devicetype=2" class="detail_a">线路列表</a>';
//					}
//					div += '<a href="'+contextPath+'user/z/zyznglkgadd.jsp" class="detail_a">添加</a>';
					
					
					if(mediumeditaction){
						div += '<a href="'+contextPath+'user/z/zyznglkgedite.jsp?deviceid='+obj[i].deviceid+'" class="detail_a">编辑</a>';
					}
					if(mediumdeleteaction){
						div += '<a href="javascript:devicedel(\'zyznglkg\',\''+obj[i].deviceid+'\''+',0,0);"  class="detail_a">删除</a>';
					}
					div +=	'</li>';
					div += '</ul>';
					$(".pwsj_right_byq_divbox").append(div);
				}
				pageList(list);
			}
		}
	});
}